<!DOCTYPE html>
            
<HTML>
<HEAD>
<meta name="booktitle" content="Developing Applications With Objective Caml" >
 <meta charset="ISO-8859-1"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<META name="GENERATOR" content="hevea 1.05-7 of 2000-02-24">
<META NAME="Author" CONTENT="Christian.Queinnec@lip6.fr">
<LINK rel=stylesheet type="text/css" href="videoc-ocda.css">
<script language="JavaScript" src="videoc.js"><!--
//--></script>
<TITLE>
 Installation
</TITLE>
</HEAD>
<BODY class="regularBody">
<A HREF="book-ora008.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora010.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2> Installation</H2>
<A NAME="@concepts0"></A>Installing Objective CAML requires about 10MB of free space on one's hard
disk drive. The software can easily be uninstalled without corrupting the
system.<BR>
<BR>
<A NAME="toc3"></A>
<H3> Installation under Windows</H3>
<A NAME="@concepts1"></A>
The file containing the binary distribution is called:
<CODE>ocaml-2.04-win.zip</CODE>, indicating the version number (here
<CODE>2.04</CODE>) and the operating system.<BR>
<BR>


<H3> Warning </H3> <HR>

Objective CAML only works under recent versions
of Windows : Windows 95, 98 and NT. 
Don't try to install it under Windows 3.x or
OS2/Warp.


<HR>

<BR>
<BR>
<OL type=1>
<LI>
 
The file is in compressed (<CODE>.zip</CODE>) format; the first thing to do
is decompress it. Use your favorite decompression software for this.
You obtain in this way a file hierarchy whose root is named <TT>ocaml</TT>. 
You can place this directory at any location on your hard disk.
It is denoted by <CODE>&lt;caml-dir&gt;</CODE> in what follows.

<LI> This directory includes:<BR>
<BR>
<UL>
<LI>
 two subdirectories: <TT>bin</TT> for binaries and <TT>lib</TT>
for libraries;

<LI> two ``text'' files: <TT>License.txt</TT> and <TT>Changes.txt</TT>
containing the license to use the software and the changes relative to
previous versions;

<LI> an application: <TT>OCamlWin</TT> corresponding to the main application;

<LI> a configuration file: <TT>Ocamlwin.ini</TT> which will need to be
modified (see the following point);

<LI> two files of version notes: the first, <TT>Readme.gen</TT>, for this
version and the second, <TT>Readme.win</TT>, for the version under
Windows.
</UL>

<LI> If you have chosen a directory other than <CODE>c:\ocaml</CODE> as the
root of your file hierarchy, then it is necessary to indicate this in the
configuration file. Edit it with <TT>Wordpad</TT> and change the line
defining
<TT>CmdLine</TT> which is of the form:
<PRE>
CmdLine=ocamlrun c:\ocaml\bin\ocaml.exe -I c:\ocaml\lib
</PRE>to
<PRE>
CmdLine=ocamlrun &lt;caml-dir&gt;\bin\ocaml.exe -I &lt;caml-dir&gt;\lib
</PRE>You have to replace the names of the search paths for binaries and
libraries with the name of the Objective CAML root directory. If we have chosen
<CODE>C:\Lang\ocaml</CODE> as the root directory (<CODE>&lt;caml-dir&gt;</CODE>), the
modification becomes: 

<PRE>
CmdLine=ocamlrun C:\Lang\ocaml\bin\ocaml.exe -I C:\Lang\ocaml\lib
</PRE>

<LI> Copy the file OCamlWin.ini to the main system directory, that is,
<CODE>C:\windows</CODE>
or <CODE>C:\win95</CODE> or <CODE>C:\winnt</CODE> according to the
installation of your system.
</OL>Now it's time to test the <TT>OCamlWin</TT> application by double-clicking on
it. You'll get the window in figure <A HREF="book-ora009.html#fig-ocamlwin">1.1</A>.<BR>
<BR>
<BLOCKQUOTE><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
<DIV ALIGN=center>
<IMG SRC="book-ora001.gif">
<BR>
<BR>
<DIV ALIGN=center>Figure 1.1: Objective CAML window under Windows.</DIV><BR>

<A NAME="fig-ocamlwin"></A>
</DIV>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>The configuration of command-line executables, launched from a DOS window,
is done by modifying the <TT>PATH</TT><TT> variable and the </TT><TT>Objective CAML</TT> library
search path variable (<TT>CAMLLIB)</TT>, as follows:
<PRE>
PATH=%PATH%;&lt;caml-dir&gt;\bin
set CAMLLIB=&lt;caml-dir&gt;\lib
</PRE>where <CODE>&lt;caml-dir&gt;</CODE> is replaced by the path where
Objective CAML is installed.<BR>
<BR>
These two commands can be included in the <TT>autoexec.bat</TT> file which
every good DOS has. To test the command-line executables, type the command
<TT>ocaml</TT> in a DOS window. This executes the file:
<PRE>
&lt;caml-dir&gt;/bin/ocaml.exe
</PRE>corresponding to the Objective CAML. text mode toplevel. To exit from this
command, type <CODE>#quit;;</CODE>.<BR>
<BR>
To install Objective CAML from source under Windows is not so easy,
because it requires the use of commercial software, in particular the
Microsoft C compiler. Refer to the file <TT>Readme.win</TT>
of the binary distribution to get the details.<BR>
<BR>
<A NAME="toc4"></A>
<H3> Installation under Linux</H3>
<A NAME="@concepts2"></A>The Linux installation also has an easy-to-install
binary distribution in the form of an <TT>rpm</TT>. package. Installation
from source is described in section 
<A HREF="book-ora009.html#subsec-insunix">1</A>. 
The file to download is:
<CODE>ocaml-2.04-2.i386.rpm</CODE>
which will be used as follows with root privileges:
<PRE>
rpm -i ocaml-2.04-2.i386.rpm
</PRE>which installs the executables in the <TT>/usr/bin</TT> directory and the
libraries in the <TT>/usr/lib/ocaml</TT> directory.<BR>
<BR>
To test the installation, type: <TT>ocamlc -v</TT> 
which prints the version of Objective CAML installed on the machine.
<PRE>
ocamlc -v
The Objective Caml compiler, version 2.04
Standard library directory: /usr/lib/ocaml
</PRE>You can also execute the command <TT>ocaml</TT> which prints the
header of the interactive toplevel.
<PRE>
        Objective Caml version 2.04

# 
</PRE>The <TT>#</TT> character is the prompt in the interactive toplevel.
This interactive toplevel can be exited by the 
<CODE>#quit;;</CODE> directive, or by typing <CODE>CTRL-D</CODE>. 
The two semi-colons indicate the end of an Objective CAML phrase.<BR>
<BR>
<A NAME="toc5"></A>
<H3> Installation under MacOS</H3>
<A NAME="@concepts3"></A>The MacOS distribution is also in the form of a
self-extracting binary. The file to download is:
<TT>ocaml-2.04-mac.sea.bin</TT> which is compressed. Use your favorite
software to decompress it. Then all you have to do to install it is launch
the self-extracting archive and follow the instructions printed in the
dialog box to choose the location of the distribution.
For the MacOS X server distribution, follow the installation from source under
Unix.<BR>
<BR>
<A NAME="toc6"></A>
<H3> Installation from source under Unix</H3>
<A NAME="@concepts4"></A><A NAME="subsec-insunix"></A>
Objective CAML can be installed on systems in the Unix
family from the
source distribution. Indeed it will be necessary to compile the Objective CAML
system. To do this, one must either have a C compiler on one's Unix,
machine, which is generally the case, or download one such as
<TT>gcc</TT> which works on most Unix. systems. The Objective CAML distribution
file containing the source is: <TT>ocaml-2.04.tar.gz</TT>. The file <TT>INSTALL</TT> describes, in a very clear way, the various
stages of configuring, making, and then installing the binaries.<BR>
<BR>
<A NAME="toc7"></A>
<H3> Installation of the HTML documentation</H3>
<A NAME="@concepts5"></A><A NAME="subsec-manref"></A>
Objective CAML's English documentation is present also in the form of
a hierarchy of HTML files which can be found in the 
<TT>docs</TT> directory of the CD-ROM.<BR>
<BR>
This documentation is a reference manual. It is not easy reading for the
beginner. Nevertheless it is quite useful as a description of the
language, its tools, and its libraries. It will soon become indispensable
for anyone who hopes to write a program of more than ten lines. <BR>
<BR>
<HR>
<A HREF="book-ora008.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora010.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
